package com.bakerj.infinitecards.transformer;

import com.bakerj.infinitecards.CardItem;
import com.bakerj.infinitecards.ZIndexTransformer;

/**
 * DefaultZIndexTransformerCommon
 *
 * @author BakerJ
 * @since : 2021.5.24
 */
public class DefaultZIndexTransformerCommon implements ZIndexTransformer {
    @Override
    public void transformAnimation(CardItem card, float fraction, int cardWidth,
                                    int cardHeight, int fromPosition, int toPosition) {
        card.zIndex = (float) (1F + 0.01F * (double)fromPosition + 0.01F * (toPosition - fromPosition) * fraction);
    }

    @Override
    public void transformInterpolatedAnimation(CardItem card, float fraction, int cardWidth,
                                                int cardHeight, int fromPosition, int toPosition) {
    }
}
